package com.jingtai.shop.webfacade.bo.user;

import cn.hutool.core.util.ObjectUtil;
import com.jingtai.common.webfacade.BaseBO;
import com.jingtai.common.webfacade.error.CommonException;
import com.jingtai.common.webfacade.error.ErrorEnum;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * 用户获取验证码
 */
@Data
public class UserObtainCodeBO extends BaseBO {
    /**
     * 用户名/手机号
     */
    private String phone;

    /**
     * 状态 0,注册;1,忘记密码
     */
    private Integer estate;

    @Override
    public void validate() {
        super.validate();
        if (StringUtils.isEmpty(phone) || ObjectUtil.isEmpty(estate)){
            throw new CommonException(ErrorEnum.REQUIRED_PARAM_EMPTY);
        }
    }
}
